<?php

namespace Modules\Admin\Http\Controllers;

use Illuminate\Support\Facades\Request;
use Modules\Admin\Service\UserService;


class UserController extends BaseController
{

	// private $sex_types = ['1'=>'男','2'=>'女','3'=>'保密'];
	/**
	 *	会员列表
	 *	hinq 2019 08 27
	 *
	 **/
	public function index(){

		$arr_search = (array)Request::input();
		$arr_list = UserService::get_list( (array) $arr_search );
		echo_error($arr_list);
		return view('admin::user.index',$arr_list['data'] );
	}


	/**
	 * 	启用、禁用会员
	 *	hinq 2019 08 27
	 *
	 **/
	public function update(){
		$arrInput = (array) Request::all();
		return UserService::edit_one( (array) $arrInput );
	}

	/**
	 *	会员积分明细列表
	 *	hinq 2019 08 28 
	 *
	 **/
	public function list(){
		$arr_search = (array) Request::all();
		$arr_list = UserService::get_list_integral( (array) $arr_search );
		echo_error($arr_list);
		return view('admin::user.list',$arr_list['data']);
	}

	/**
	 *	会员积分明细列表【用户详细页面的接口】
	 *	hinq 2019 08 28 
	 *
	 **/
	public function detail_list(){
		$user_id = (int) Request::get('user_id');
		$arr_list = UserService::get_detail_list( (int) $user_id );
		return $arr_list;
	}

	/**
	 *	获取会员积分订单明细
	 *	hinq 2019 10 17
	 *
	 **/
	public function integral_order_list(){
		$user_id = (int) Request::get('user_id');
		$arr_list = UserService::get_integral_order_list( (int) $user_id );
		return $arr_list;
	}


	/**
	 *	获取会员服务订单明细
	 *	hinq 2019 10 18
	 *
	 **/
	public function repairstore_order_list(){
		$user_id = (int) Request::get('user_id');
		$arr_list = UserService::get_repairstore_order_list( (int) $user_id );
		return $arr_list;
	}

	/**
	 *	获取会员预约订单明细
	 *	hinq 2019 10 18
	 *
	 **/
	public function checkpoint_order_list(){
		$user_id = (int) Request::get('user_id');
		$arr_list = UserService::get_checkpoint_order_list( (int) $user_id );
		return $arr_list;
	}
	

	/**
	 *	获取会员优惠券明细
	 *	hinq 2019 10 18
	 *
	 **/
	public function user_coupon_list(){
		$user_id = (int) Request::get('user_id');
		$arr_list = UserService::get_user_coupon( (int) $user_id );
		return $arr_list;
	}


	
	/**
	 *	用户详情
	 *	hinq 2019 10 17
	 *
	 **/
	public function detail(){
		$user_id = (int) Request::get('user_id');
		$arr_list = UserService::get_user_detail( (int) $user_id );
		echo_error($arr_list);
		return view('admin::user.detail',$arr_list);
	}

	/**
	 *  获取用户的所有车辆信息
     *  hinq 2019 12 07
     *
     **/
	public function user_vehicle_list(){
        $user_id = (int) Request::get('user_id');
        $arr_list = UserService::user_vehicle_list( (int) $user_id );
        return $arr_list;
    }




}